OWASP Secure Coding Practices-Quick Reference Guide
OWASP Secure Coding Practices-Quick Reference Guide | OWASP Foundation
和譯 : OWASP Secure Coding Practices – Quick Reference Guide – yohgaki's blog
OWASP Secure Coding Practices – Quick Reference Guide – yohgaki's blog
TODO : OWASP Developer Guide | OWASP Foundation を確認せよ
OWASP Top Ten | OWASP Foundation
Overview - OWASP Developer Guide
OWASP Application Security Verification Standard (ASVS) | OWASP Foundation
v2.0.1
Guidance on implementing a secure software development framework. 安全な software 開發 framework の實裝に關する手引き
Clearly define roles and responsibilities
役割と責任を明確にする
Provide development teams with adequate software security training
開發 team は software security について適切に訓練する
Implement a secure software development lifecycle
安全な software 開發 lifecycle を實裝する
Establish secure coding standards
安全な coding 標準を確立する
OWASP Development Guide Project
OWASP Developer Guide | OWASP Foundation
Build a re-usable object library
再利用可能な object library を構築する
OWASP Enterprise Security API (ESAPI) Project
OWASP Enterprise Security API (ESAPI) | OWASP Foundation
Verify the effectiveness of security controls. security
制禦の有效性を檢證する
OWASP Application Security Verification Standard (ASVS) Project
OWASP Application Security Verification Standard (ASVS) | OWASP Foundation
OWASP/ASVS: Application Security Verification Standard
Establish secure outsourced development practices including defining security requirements and verification methodologies in both the request for proposal (RFP) and contract
提案依賴書 (RFP) と契約書の兩方で security 要件と檢證方法を定義するなど、安全な外部委託開發慣行を確立する
Secure Coding Practices Checklist
Input Validation. 入力の檢證
Conduct all data validation on a trusted system (e.g., The server)
信賴する system (例 : server) で全ての data 檢證を管理する
Identify all data sources and classify them into trusted and untrusted. Validate all data from untrusted sources (e.g., Databases, file streams, etc.)
全ての data 源を特定し、信賴できる data 源と信賴できない data 源に區別する。信賴できない data 源からの全ての data を檢證する (例 : database、file stream 等)
There should be a centralized input validation routine for the application
application には入力の檢證を一箇所で一遍に行ふ仕組みがなければならない
Specify proper character sets, such as UTF-8, for all sources of input
全ての入力源に UTF-8 等の適切な文字 encoding を指定する
Encode data to a common character set before validating (Canonicalize)
檢證する前に data を共通の文字 encoding に變換する (正規化する)
All validation failures should result in input rejection
檢證に失敗した data は入力を拒否しなければならない
Determine if the system supports UTF-8 extended character sets and if so, validate after UTF-8 decoding is completed
system が UTF-8 擴張文字集合を利用してもよいとしてゐるか確認し、もし利用してもよいとしてゐるならば UTF-8 の decode が完了してから檢證する
Unicode - Wikipedia#拡張領域
Validate all client provided data before processing, including all parameters, URLs and HTTP header content (e.g. Cookie names and values). Be sure to include automated post backs from JavaScript, Flash or other embedded code
client から受け取った、URL や HTTP header (例 : Cookie の名と値) を含む全ての data を檢證する。この data には JavaScript や Flash や他の埋め込み code から自動送信された data も含まれる事に注意する
Verify that header values in both requests and responses contain only ASCII characters
request と response 雙方の header が ASCII 文字しか含まない事を檢證する
Validate data from redirects (An attacker may submit malicious content directly to the target of the redirect, thus circumventing application logic and any validation performed before the redirect)
redirect で受け取った data を檢證する (攻擊者は惡意有る data を redirect 先に直接に送信するかもしれず、さうすると redirect の前に實行する application の處理やあらゆる檢證を囘避できる)
Validate for expected data types
期待する data 型であるか檢證する
Validate data range
data の範圍を檢證する
Validate data length
data の長さを檢證する
Validate all input against a "white" list of allowed characters, whenever possible
可能な限り、全ての入力を、許可された文字の allow list を使って檢證する
If any potentially hazardous characters must be allowed as input, be sure that you implement additional controls like output encoding, secure task specific APIs and accounting for the utilization of that data throughout the application . Examples of common hazardous characters include: < > " ' % ( ) & + \ \' \"
入力に潛在的に危險な文字を許可しなければならない場合、出力 encoding や、特定の task に對して安全な API 等の追加の對策を實裝し、危險な文字を含みうる data が application 全體でどう利用されるか把握する。よくある危險な文字は以下: < > " ' % ( ) & + \ \' \"
If your standard validation routine cannot address the following inputs, then they should be checked discretely
標準的に利用する檢證處理が以下の入力に對應できない場合は、個別に檢査しなければならない
Check for null bytes (%00)
null 文字を檢査する (%00)
Check for new line characters (%0d, %0a, \r, \n)
改行文字を檢査する (%0d, %0a, \r, \n)
Check for “dot-dot-slash" (../ or ..\ ) path alterations characters. In cases where UTF-8 extended character set encoding is supported, address alternate representation like: %c0%ae%c0%ae/ (Utilize canonicalization to address double encoding or other forms of obfuscation attacks)
path を切り替へる文字列 (../ や ..\ ) を檢査する。UTF-8 擴張文字集合を利用できるならば、以下の樣な代替する表現も檢査する : %c0%ae%c0%ae/ (正規化を行ひ、二重 encoding やその他の難讀化攻撃に對處する)
Output Encoding. 出力の encoding
Conduct all encoding on a trusted system (e.g., The server)
信賴する system 上の全ての encoding を管理する (例 : server)
Utilize a standard, tested routine for each type of outbound encoding
出力する encoding の種類每に標準の test 濟みの處理を使ふ
Contextually output encode all data returned to the client that originated outside the application's trust boundary. HTML entity encoding is one example, but does not work in all cases
application の信賴境界の外から得た data を client に返す場合は全てを環境に應じて encode する。例へば HTML 實體に encode する、ただしそれで全て濟む訣ではない
? HTML entity を何と和譯するか
Entity (エンティティ) - MDN Web Docs 用語集: ウェブ関連用語の定義 | MDN
SGML実体 - Wikipedia
文字参照 - Wikipedia
Extensible Markup Language - Wikipedia#実体参照
Encode all characters unless they are known to be safe for the intended interpreter
出力を解釋する側にとって安全であるとわかってゐるものを除き、全ての出力を encode する
Contextually sanitize all output of un-trusted data to queries for SQL, XML, and LDAP
SQL、XML 及び LDAP への問ひ合はせに含める、信賴できない全ての data を環境に應じて無害化する
Sanitize all output of un-trusted data to operating system commands
OS command に含める、信賴できない全ての data を無害化する
Authentication and Password Management. 認證と password 管理
Require authentication for all pages and resources, except those specifically intended to be public
特別に公開するやう意圖したものを除いて、全ての頁と resource に access するには認證を要求する
All authentication controls must be enforced on a trusted system (e.g., The server)
全ての認證は信賴する system が制禦して實施しなければならない (例 : server)
Establish and utilize standard, tested, authentication services whenever possible
標準的で test された認證 service を可能な限り作り上げ利用する
※IDaaS のやうな外部の認證 service を利用しても良い
Use a centralized implementation for all authentication controls, including libraries that call external authentication services
library や外部の認證 service を呼び出す場合も含めて、全ての認證の制禦が中央管理されるやうに實裝する
Segregate authentication logic from the resource being requested and use redirection to and from the centralized authentication control
認證 logic を request された resource から分離し、中央管理してゐる認證の制禦との閒で redirect を利用して遣り取りする
認證用の server を分離する
All authentication controls should fail securely
全ての認證の制禦は安全に失敗しなければならない
All administrative and account management functions must be at least as secure as the primary authentication mechanism
全ての管理者向け機能と account 管理機能は少なくとも主たる認證機能と同程度に安全でなければならない
If your application manages a credential store, it should ensure that only cryptographically strong one-way salted hashes of passwords are stored and that the table/file that stores the passwords and keys is write-able only by the application. (Do not use the MD5 algorithm if it can be avoided)
application が credention store を管理してゐるならば、password の 暗號論的に強い一方向 salt 附き hash のみを保存し、password・鍵を保存してゐる table・file には管理する application のみが書き込めるやうにする。(MD5 は避けられるなら使はない)
Password hashing must be implemented on a trusted system (e.g., The server)
password の hash 化は信賴できる system (例 : server) で行はなければならない
Validate the authentication data only on completion of all data input, especially for sequential authentication implementations
認證 data は全て受け取ってから檢證する、特に逐次認證を實裝する場合は
逐次認證
2-page login pattern
1 つ目の頁で、E-mail address を入力させる
E-mail address に對應する account が system に在るか確認し、在り、かつ SSO に結び附いてゐれば SSO で login する畫面に遷移する
system の仕樣の範圍內で、user が在るか無いか確認する攻撃に利用されない樣に注意する
E-mail address に對應する account が system に無い、或いは在っても SSO に結び附いてゐないならば password を入力する畫面に遷移する
畫面を遷移するよりは、form に password 入力欄を動的に追加するはうが、user が誤入力を訂正するのに便利だらう
E-mail address か password の何が誤ってゐるかは error message に含めない
UX Review: Google’s 2 step login. An in-depth look at Google login’s UX… | by Gautam Krishnan | UX Reviews | Medium
Usability Research on Federated Login - Internet Identity Research
User Experience summary for Federated Login - Internet Identity Research
多要素認證を複數の段階に分けて行ふ場合
Authentication failure responses should not indicate which part of the authentication data was incorrect. For example, instead of "Invalid username" or "Invalid password", just use "Invalid username and/or password" for both. Error responses must be truly identical in both display and source code
認證に失敗した時の response に認證 data のどの部分が誤ってゐたかを示さない。例へば、「不正な user 名です」や「不正な password です」と表示する替はりに「user 名と password のどちらかまたは兩方が不正です」と表示する。error response は表示上と source code 上とで全く同一でなければならない
Utilize authentication for connections to external systems that involve sensitive information or functions
機密の data や機能を利用する外部 system に接續する際には認證する
Authentication credentials for accessing services external to the application should be encrypted and stored in a protected location on a trusted system (e.g., The server). The source code is NOT a secure location
application の外部の service に接續する爲の認證 credential は保護された場所に在る信賴する system (例 : server) に暗號化して保存しなければならない。source code は安全な場所ではない
Use only HTTP POST requests to transmit authentication credentials
認證 credential を送信するにはHTTP POST request のみを用ゐる
Only send non-temporary passwords over an encrypted connection or as encrypted data, such as in an encrypted email. Temporary passwords associated with email resets may be an exception
一時的でない password は暗號化された接續で、もしくは暗號化された E-mail の樣な暗號化された data としてのみ送信する。E-mail reset に關する一次的な password は例外である
Enforce password complexity requirements established by policy or regulation. Authentication credentials should be sufficient to withstand attacks that are typical of the threats in the deployed environment. (e.g., requiring the use of alphabetic as well as numeric and/or special characters)
方針または規制によって定めた password の複雜さについての要件を強制する。認證 credential は deploy した環境における典型的な脅威による攻撃に耐へるに充分でなければならない。(例 : 數字はもちろん alphabet や特殊文字のいづれかもしくは全てを使ふやう要求する)
Enforce password length requirements established by policy or regulation. Eight characters is commonly used, but 16 is better or consider the use of multi-word pass phrases
方針または規制によって定めた password の長さについての要件を強制する。8 文字がよく使はれるが、16 文字のはうがよく、複數の單語を使ふ pass phrase の利用も檢討する
Password entry should be obscured on the user's screen. (e.g., on web forms use the input type "password")
password の入力內容は user の畫面上で見えない樣にする。(例 : Web の form で input の type に "password" を指定する)
Enforce account disabling after an established number of invalid login attempts (e.g., five attempts is common). The account must be disabled for a period of time sufficient to discourage brute force guessing of credentials, but not so long as to allow for a denial-of-service attack to be performed
不正な login 試行が既定の囘數 (例 : 一般的には 5 囘) 行はれたら account を強制的に無效にする。總當たりによって credential を推測するのを諦めさせるに充分な期閒、ただし service 妨礙攻撃が成立する程には長くない期閒だけ account を無效にしなければならない
Password reset and changing operations require the same level of controls as account creation and authentication
password の reset と變更の操作には account の作成及び認證と同じ水準の制禦を要求する
Password reset questions should support sufficiently random answers. (e.g., "favorite book" is a bad question because “The Bible” is a very common answer)
password reset の質問は充分に random な囘答が得られるものでなくてはならない。(例 :「好きな本」は「聖書」は非常に一般的な囘答であるから惡い質問である)
If using email based resets, only send email to a pre-registered address with a temporary link/password
E-mail による reset を行ふ場合は、登錄濟みの E-mail にのみ一時的な link や password を送信する
Temporary passwords and links should have a short expiration time
一時的な password や link の有效期限は短くしなくてはならない
Enforce the changing of temporary passwords on the next use
一時的な password は次囘利用時に變更するやう強制する
Notify users when a password reset occurs
password の reset が行はれたら user に通知する
Prevent password re-use
password の再利用を禁ずる
Passwords should be at least one day old before they can be changed, to prevent attacks on password re-use
password は少なくとも 1 日經過してから變更できる樣にする事で、password を再利用する攻撃を防ぐ
Enforce password changes based on requirements established in policy or regulation. Critical systems may require more frequent changes. The time between resets must be administratively controlled
方針または規制によって定めた要件に基づき password の變更を強制する。重要な system ではより頻繁に變更する樣に求められるかもしれない。reset の閒隔は管理者が制禦しなければならない
Disable "remember me" functionality for password fields
password 欄の "remember me" 機能を無效にする
The last use (successful or unsuccessful) of a user account should be reported to the user at their next successful login
user account の最後の利用 (成功も失敗も) を次囘の login 成功時に user に報せなければならない
Implement monitoring to identify attacks against multiple user accounts, utilizing the same password. This attack pattern is used to bypass standard lockouts, when user IDs can be harvested or guessed
同じ password を使ふ複數の user account に對する攻撃を檢出する監視を實裝する。この攻撃 pattern は user ID を知る事ができるもしくは推測できる場合に標準的な締め出しを囘避しようとして行はれる
Change all vendor-supplied default passwords and user IDs or disable the associated accounts
vender の提供する既定の password と user ID は全て變更するか、關聯する account を無效にする
Re-authenticate users prior to performing critical operations
重要な操作を行ふ前に user を再認證する
Use Multi-Factor Authentication for highly sensitive or high value transactional accounts
機密性の高いもしくは價値の高い處理を行ふ account には多要素認證を利用する
If using third party code for authentication, inspect the code carefully to ensure it is not affected by any malicious code
認證に 3rd party の code を使ふならば、code を注意深く檢査して、惡意のある code の影響を受けてゐない事を確認する
Session Management. session 管理
Use the server or framework’s session management controls. The application should only recognize these session identifiers as valid
server もしくは framework の session 管理機能を使ふ。application はこれらの session 識別子のみを妥當なものだと認識しなければならない
※擴張していけない訣ではない
Session identifier creation must always be done on a trusted system (e.g., The server)
session 識別子は常に信賴する system (例 : server) 上で生成しなければならない
Session management controls should use well vetted algorithms that ensure sufficiently random session identifiers
session 管理制禦ではよく調べられた algorithm を使って session識別子が充分に random になるやう保證しなければならない
Set the domain and path for cookies containing authenticated session identifiers to an appropriately restricted value for the site
認證濟みの session 識別子を含む cookie には Web site に適した domain と path を設定し制限する
Logout functionality should fully terminate the associated session or connection
logout 機能は關聯する session や接續を完全に終了させねばならない
Logout functionality should be available from all pages protected by authorization
logout 機能は權限によって保護された全ての頁から利用できねばならない
Establish a session inactivity timeout that is as short as possible, based on balancing risk and business functional requirements. In most cases it should be no more than several hours
risk と業務要件の balance を考へて可能な限り inactive な session の期限を短く設定する。通常は數時閒以內にするべきである。
※時閒は例よりももっと長くてよい
Disallow persistent logins and enforce periodic session terminations, even when the session is active. Especially for applications supporting rich network connections or connecting to critical systems. Termination times should support business requirements and the user should receive sufficient notification to mitigate negative impacts
永續的な login を禁止し、session が active でも一定期間で強制的に終了する。rich な network 接續や重要な system に接續する application では尚更である。session を終了する時閒は業務要件に基づくべきであり、user が惡影響を緩和できる樣に充分な通知を送るべきである
If a session was established before login, close that session and establish a new session after a successful login
login 前に session が確立されてゐた場合、login 成功後にその session を終了し新しい session を確立する
session 固定化攻撃
Session fixation - Wikipedia
Generate a new session identifier on any re-authentication
再認證時には必ず新しい session 識別子を生成する
Do not allow concurrent logins with the same user ID
同じ user ID での同時 login を許可しない
Do not expose session identifiers in URLs, error messages or logs. Session identifiers should only be located in the HTTP cookie header. For example, do not pass session identifiers as GET parameters
URL・error message・log に session 識別子を露出させない。session 識別子は HTTP の cookie header でのみ扱はなければならない。例へば、session 識別子を GET parameter に載せてはならない
Protect server side session data from unauthorized access, by other users of the server, by implementing appropriate access controls on the server
適切な access 制禦を server に實裝し、認證してゐない他の user や server に晒されない樣、server 上の session data を保護する
Generate a new session identifier and deactivate the old one periodically. (This can mitigate certain session hijacking scenarios where the original identifier was compromised)
定期的に新しい session ID を生成して古いものを無效にする。(これにより元の識別子が侵害されて起こる session hijacking 攻撃を緩和できる)
Generate a new session identifier if the connection security changes from HTTP to HTTPS, as can occur during authentication. Within an application, it is recommended to consistently utilize HTTPS rather than switching between HTTP to HTTPS
認證處理中などで HTTP から HTTPS に接續を變更した場合は新しい session 識別子を生成する。application 內では HTTP と HTTPS を切り替へるのではなく、常に HTTPS を使ふのが望ましい
Supplement standard session management for sensitive server-side operations, like account management, by utilizing per-session strong random tokens or parameters. This method can be used to prevent Cross Site Request Forgery attacks
account 管理等の機密性の高い sever 側操作に於いて、session 每に發行する強力な random token や parameter を利用する事で標準的な session 管理をより強力にする。この手法は CSRF (cross-site request forgery) 攻撃を防止できる
令和時代の API 実装のベースプラクティスと CSRF 対策 | blog.jxck.io
Supplement standard session management for highly sensitive or critical operations by utilizing per-request, as opposed to per-session, strong random tokens or parameters
機密性の非常に高い sever 側操作に於いて、session 每ではなく request 每に發行する強力な random token や parameter を利用する事で標準的な session 管理をより強力にする
Set the "secure" attribute for cookies transmitted over an TLS connection
TLS 接續を介して送信される cookie に「secure」属性を設定する
Set cookies with the HttpOnly attribute, unless you specifically require client-side scripts within your application to read or set a cookie's value
application 內の client 側 script が cookie を讀み書きする必要が明確に存る場合を除き、cookie に HttpOnly 屬性を設定する
Access Control. access 制禦
Use only trusted system objects, e.g. server side session objects, for making access authorization decisions
access 權限の判定には、server 上の session object 等の信賴できる system object のみを利用する
Use a single site-wide component to check access authorization. This includes libraries that call external authorization services
access 權限の檢査には Web site 全體で單一の component を利用する。component は 外部の認可 service を呼び出す library である場合もある
Access controls should fail securely
access 制禦は安全に失敗せねばならない
Deny all access if the application cannot access its security configuration information
application はもし security 設定の情報を利用できない場合には全ての access を拒否する
Enforce authorization controls on every request, including those made by server side scripts, "includes" and requests from rich client-side technologies like AJAX and Flash
server 上の script ・「include」・AJAX や Flash 等の rich client-side 技術等によって行はれるものを含め、全ての request の認可 (authz)を強制的に制禦する
Segregate privileged logic from other application code
特權的な機能と application の他の code とを隔離する
Restrict access to files or other resources, including those outside the application's direct control, to only authorized users
application が直接に制禦してゐない resource であっても、file や resource には許可を受けた user のみが access できるやう制限する
Restrict access to protected URLs to only authorized users
許可を受けた user のみが保護された URL に access できるやう制限する
Restrict access to protected functions to only authorized users
許可を受けた user のみが保護された機能に access できるやう制限する
Restrict direct object references to only authorized users
許可を受けた user のみが直接 object 參照できるやう制限する
直接 object 參照
IDOR (insecure direct object reference)
Insecure direct object reference - Wikipedia
IDORとは? - 不正な直接オブジェクト参照
Restrict access to services to only authorized users
許可を受けた user のみが service に access できるやう制限する
Restrict access to application data to only authorized users
許可を受けた user のみが application の data に access できるやう制限する
Restrict access to user and data attributes and policy information used by access controls
許可を受けた user のみが access 制禦で使ふ user 屬性・data 屬性・policy 情報に access できるやう制限する
Restrict access security-relevant configuration information to only authorized users
許可を受けた user のみが security に關聯する設定情報に access できるやう制限する
Server side implementation and presentation layer representations of access control rules must match
server 上で實裝する access 制禦規則と presentation 層での access 制禦規則の表現とは一致しなければならない
※UI 上ではできないやうに見せておいて、UI を迂回すると実は操作できてしまふ事を防ぐ
If state data must be stored on the client, use encryption and integrity checking on the server side to catch state tampering
client に data を保存する必要がある場合は、狀態の改竄を檢知できるやう server 側で暗號化し整合性を檢査する
※client 側で改竄されると處理に支障のある data に限る
Enforce application logic flows to comply with business rules
application の logic を business rule に準據させる
Limit the number of transactions a single user or device can perform in a given period of time. The transactions/time should be above the actual business requirement, but low enough to deter automated attacks
一人の user もしくは機器が一定時閒內に實行できる transaction 數を制限する。この上限は實際の業務要件を上囘る必要があるが、自動的な攻撃を抑止できる程度には低くせねばならない
Use the "referer" header as a supplemental check only, it should never be the sole authorization check, as it is can be spoofed
「referer」header は僞裝できるので、決してそれだけを檢査して認可してはならず、補助的な檢査としてのみ利用する
If long authenticated sessions are allowed, periodically re-validate a user’s authorization to ensure that their privileges have not changed and if they have, log the user out and force them to re-authenticate
認證 session の期限を長くとってもよいとしてゐる場合、定期的に user の認可 (authz)を再檢證し權限が變更されてゐない事を確認する。もし權限が變更されてゐたならば、user を logout させ強制的に再認證する
Implement account auditing and enforce the disabling of unused accounts (e.g., After no more than 30 days from the expiration of an account’s password.)
account を監査し使ってゐない account を強制的に無效化する (例 : account の password の期限が失效してから 30 日經過した)
The application must support disabling of accounts and terminating sessions when authorization ceases (e.g., Changes to role, employment status, business process, etc.)
application は認可 (authz)が失效した場合 (例 : 役割・雇用狀態・業務手順が變化した) に account を無效化し session を終了できる樣にしておかねばならない
Service accounts or accounts supporting connections to or from external systems should have the least privilege possible
service account や外部の system を遣り取りする account にはできる限り最小の權限を附與せねばならない
Create an Access Control Policy to document an application's business rules, data types and access authorization criteria and/or processes so that access can be properly provisioned and controlled. This includes identifying access requirements for both the data and system resources
application の business rule・data 種別・access 制禦の基準や process を文書化した access 制禦方針を制定する。これにより access は適切に行はれ制禦されるやうになる。data と system resource への access 要件も特定し記載する
"Access Control Policy" で廣く通用する熟語
アクセス制御ポリシー | 用語集 | ビジネスコラム | 楽天モバイル 法人・ビジネスのお客様
Cryptographic Practices. 暗號の取り扱ひ
All cryptographic functions used to protect secrets from the application user must be implemented on a trusted system (e.g., The server)
application の user から祕密を保護するのに用ゐられる暗號に關する全ての機能は信賴する system (例 : server) 上で實裝せねばならない
Protect master secrets from unauthorized access
樞要となる祕密を不正な access から保護する
Cryptographic modules should fail securely
暗號 module は安全に失敗せねばならない
All random numbers, random file names, random GUIDs, and random strings should be generated using the cryptographic module’s approved random number generator when these random values are intended to be un-guessable
推測を困難にしたい全ての亂數・random な file 名・random で global な一意識別子 (GUID)・random な文字列は、暗號 module が含む確認濟みの亂數生成器を用ゐて生成せねばならない
GUID : 重複しない識別子
Cryptographic modules used by the application should be compliant to FIPS 140-2 or an equivalent standard. (See http://csrc.nist.gov/groups/STM/cmvp/validation.html )
application で使用する暗號 module は FIPS 140-2 もしくは同等の標準に準據してゐなければならない。( http://csrc.nist.gov/groups/STM/cmvp/validation.html を見よ)
Cryptographic Module Validation Program | CSRC
FIPS 140
FIPS 140 - Wikipedia
FIPS 140 - Wikipedia
FIPS 140-2
FIPS 140-2 - Wikipedia
連邦情報処理標準 (FIPS) パブリケーション 140-2 - Microsoft Compliance | Microsoft Learn
FIPS 140-3
FIPS 140-3 - Wikipedia
Establish and utilize a policy and process for how cryptographic keys will be managed
暗號鍵をどう管理するか方針と手順を確立し則る
Error Handling and Logging. error の扱ひと logging
Do not disclose sensitive information in error responses, including system details, session identifiers or account information
system の詳細・session 識別情報・account 情報などの機密情報を error 應答に含めない
Use error handlers that do not display debugging or stack trace information
debug 情報や stack trace を表示しない error handler を使ふ
Implement generic error messages and use custom error pages
汎用の error 文言を作り、custom した error page を利用する
The application should handle application errors and not rely on the server configuration
application は application の error を server の設定に任せずに處理せねばならない
Properly free allocated memory when error conditions occur
error が起こった場合には適切に割り當て濟み memory を解放する
Error handling logic associated with security controls should deny access by default
security の制禦に關する error 處理 logic では default で access を拒否せねばならない
All logging controls should be implemented on a trusted system (e.g., The server)
全ての log 機構は信賴する system (例 : server) 上で實裝せねばならない
Logging controls should support both success and failure of specified security events
log 機構は特定の security に關する事象の成功時と失敗時の兩方を扱へねばならない
Ensure logs contain important log event data
重要な事象の data を必ず log に吐く
Ensure log entries that include un-trusted data will not execute as code in the intended log viewing interface or software
信賴できない data を含む log が log を閲覽をする UI や software を利用する際に code として實行されないやうにする
Restrict access to logs to only authorized individuals
許可された者のみが log に access できるやうにする
Utilize a master routine for all logging operations
統一された處理を通して全ての log を記錄する
Do not store sensitive information in logs, including unnecessary system details, session identifiers or passwords
system の不要な詳細・session 識別子・password 等の、機密情報を log に記錄しない
Ensure that a mechanism exists to conduct log analysis
log を分析する仕組みを在らしめる
Log all input validation failures
全ての入力の檢證失敗を log に吐く
吐く log の例
code:json
{
"timestamp":"2025-08-18T03:21:45Z",
"event_type":"access_control_failure",
"principal":"user:alice@example.com",
"resource":"/api/orders/12345",
"action":"DELETE",
"decision":"deny",
"reason_code":"POLICY_NOT_OWNER",
"http_status":403,
"request_id":"req-7f3a2b",
"trace_id":"trace-abc123",
"source_ip":"203.0.113.45",
"service_name":"orders-service"
}
Log all authentication attempts, especially failures
認證の全ての試行、特に失敗は log に吐く
Log all access control failures
access 制禦の失敗を log に吐く
Log all apparent tampering events, including unexpected changes to state data
狀態 data が豫期せず變更される等の、全ての明らかな改竄事象を log に吐く
Log attempts to connect with invalid or expired session tokens
無效もしくは期限の切れた session token による接續試行を log に吐く
Log all system exceptions
system の全ての例外を log に吐く
Log all administrative functions, including changes to the security configuration settings
security 構成設定の變更を含む、全ての管理機能の動作を log に吐く
Log all backend TLS connection failures
backend での全ての TLS 接續失敗を log に吐く
Log cryptographic module failures
暗號 module の失敗を log に吐く
Use a cryptographic hash function to validate log entry integrity
log 記錄の整合性を檢證する爲に暗號 hash 函數を使ふ
Data Protection. data 保護
Implement least privilege, restrict users to only the functionality, data and system information that is required to perform their tasks
最小權限を適用し、user が仕事の遂行に必要な機能・data・system 情報のみに access できるやう制限する
Protect all cached or temporary copies of sensitive data stored on the server from unauthorized access and purge those temporary working files a soon as they are no longer required.
server 上の機密 data の cache や一時的な複製を不正な access から保護し、これらの一時的な作業 file を必要の無くなった時點で速やかに削除する
Encrypt highly sensitive stored information, like authentication verification data, even on the server side. Always use well vetted algorithms, see "Cryptographic Practices" for additional guidance
認證の檢證に使ふ data 等、機密性の高い情報は server 側にあっても暗號化して保存する。常によく調べられた algorithm を使ひ、「暗號の取り扱ひ」の節も手引きとして參照する
Protect server-side source-code from being downloaded by a user
server 側の source code が user によって download されないやう防ぐ
Do not store passwords, connection strings or other sensitive information in clear text or in any non-cryptographically secure manner on the client side. This includes embedding in insecure formats like: MS viewstate, Adobe flash or compiled code
password・接續文字列・その他の機密情報を平文のままあるいは暗號學的に安全でない如何なる方法でも client 側に保存しない。これには以下の安全でない形式に埋め込む事も含む : MS viewstate・Adobe Flash・compile 濟みの code
MS viewstate
ビューステート ASP.NET 理解する | Microsoft Learn
セキュリティに関するブリーフィング - ビューステートのセキュリティ | Microsoft Docs
Remove comments in user accessible production code that may reveal backend system or other sensitive information
user が入手できる本番環境の code から backend の system やその他の機密情報が漏洩する可能性の有る comment を削除する
Remove unnecessary application and system documentation as this can reveal useful information to attackers
application や system についての不要な文書は攻擊者にとって有用な情報を與へ得るので削除する
Do not include sensitive information in HTTP GET request parameters
HTTP GET request の parameter に機密情報を含めない
Disable auto complete features on forms expected to contain sensitive information , including authentication
認證などの機密情報を含む可能性の有る form では自動補完機能を無效にする
Disable client side caching on pages containing sensitive information. Cache-Control: no-store, may be used in conjunction with the HTTP header control "Pragma: no-cache", which is less effective, but is HTTP/1.0 backward compatible
機密情報を含む頁では client 側の cache を無效にする。Cache-Control: no-store を、效果は劣るものの HTTP/1.0 と後方互換性のある Pragma: no-cache HTTP header と倂用して利用できる
The application should support the removal of sensitive data when that data is no longer required. (e.g. personal information or certain financial data)
application は機密 data が不要になった際に削除する機能を備へてゐなければならない。(例 : 個人情報・特定の財務 data)
Implement appropriate access controls for sensitive data stored on the server. This includes cached data, temporary files and data that should be accessible only by specific system users
server 上に保存されてゐる機密 data に對して適切な access 制禦を實裝する。これには cache された data・一時 file・特定の system user のみが access できる data を含む
Communication Security. 通信の安全
Implement encryption for the transmission of all sensitive information. This should include TLS for protecting the connection and may be supplemented by discrete encryption of sensitive files or non-HTTP based connections
全ての機密 data の送信に暗號化を導入する。暗號化には TLS で接續を保護する事も考慮すべきである。また機密性の高い file や HTTP を使はない通信を各々暗號化する手段も補助的に導入してよい
TLS certificates should be valid and have the correct domain name, not be expired, and be installed with intermediate certificates when required
TLS 證明書は有效で、正しい domain 名が記載され、期限が切れてをらず、更に、中閒證明書が必要であれば install されてゐなければならない。
Failed TLS connections should not fall back to an insecure connection
TLS 接續が失敗した時、安全でない接續に fallback してはならない
Utilize TLS connections for all content requiring authenticated access and for all other sensitive information
認證濟み access の必要な全ての接續及び機密情報を扱ふ全ての接續に TLS 接續を利用する
Utilize TLS for connections to external systems that involve sensitive information or functions
機密情報或いは機密の機能に關はる外部 system への接續に TLS 接續を利用する
Utilize a single standard TLS implementation that is configured appropriately
適切に設定された單一の標準的な TLS 實裝を使ふ
Specify character encodings for all connections
全ての接續において文字 encoding を指定する
Filter parameters containing sensitive information from the HTTP referer, when linking to external sites
外部 site へ link する際に、HTTP referer 內の機密情報を含む parameter を除外する
System Configuration. system の設定
Ensure servers, frameworks and system components are running the latest approved version
server・framework・system component は最新の確認した version で稼働させる
Ensure servers, frameworks and system components have all patches issued for the version in use
server・framework・system component の使用してゐる version について發行されてゐる全ての patch が適用されてあるやうにする
Turn off directory listings
directory listing を off にする
ディレクトリリスティングとは?意味を分かりやすく解説 - IT用語辞典 e-Words
Restrict the web server, process and service accounts to the least privileges possible
Web server・process・service account の權限を可能な限り最小限にする
When exceptions occur, fail securely
例外が發生した場合には、安全に失敗する
Remove all unnecessary functionality and files
不要な機能や file を全て削除する
Remove test code or any functionality not intended for production, prior to deployment
test code や本番向けでない機能は全て、deploy 前に削除する
↓ここを譯してゐる
Prevent disclosure of your directory structure in the robots.txt file by placing directories not intended for public indexing into an isolated parent directory. Then "Disallow" that entire parent directory in the robots.txt file rather than Disallowing each individual directory
robots.txtファイルにおいて、公開インデックスを意図していないディレクトリについては、個別のディレクトリをDisallowするのではなく、それらを含む親ディレクトリ全体を"Disallow"してください。
サーチエンジンなどでのインデックスを防ぐためのrobots.txtファイルによってディレクトリ構造が漏れないようにする。公開しないディレクトリは1つのディレクトリにまとめ、個々のディレクトリ設定とせず、1つのディレクトリを指定するだけで良いディレクトリ構成にする。
公開インデックス作成を目的としていないディレクトリを分離された親ディレクトリに配置することで、robots。txt ファイル内のディレクトリ構造の漏洩を防ぎます。次に、robots。txt ファイル内の親ディレクトリ全体を、個々のディレクトリを許可しないのではなく「無効」にします
Define which HTTP methods, Get or Post, the application will support and whether it will be handled differently in different pages in the application
アプリケーションがサポートするHTTPメソッド(GETまたはPOST)、およびアプリケーションの異なるページでこれらを異なる方法で処理するかどうかを定義してください。
アプリケーションがGETまたはPOSTのどちらをサポートするのか定義し、異るページでは異る処理が行われることを明確にする。
Disable unnecessary HTTP methods, such as WebDAV extensions. If an extended HTTP method that supports file handling is required, utilize a well-vetted authentication mechanism
WebDAV拡張機能などの不要なHTTPメソッドは無效化してください。ファイル操作をサポートする拡張HTTPメソッドが必要な場合は、十分に検証済みの認証メカニズムを使用してください。
WebDAV拡張など不必要なHTTPメソッドは無効にする。もしファイル処理にHTTP拡張メソッドが必要な場合、良く検証された認証機構を利用する
If the web server handles both HTTP 1.0 and 1.1, ensure that both are configured in a similar manor or insure that you understand any difference that may exist (e.g. handling of extended HTTP methods)
WebサーバーがHTTP 1.0と1.1の両方に対応している場合、これらが同様の設定になっているか、存在する差異(例:拡張HTTPメソッドの処理方法)を理解しておく必要があります。
WebサーバーがHTTP 1.0と1.1の両方をサポートする場合、両方が同じように設定されていることを保証する。開発者が違いがあることを理解していることを保証する。(例:拡張HTTPメソッドの処理など)
Remove unnecessary information from HTTP response headers related to the OS, web-server version and application frameworks
OS、Webサーバーバージョン、およびアプリケーションフレームワークに関連するHTTPレスポンスヘッダーから、不要な情報を削除してください。
HTTPレスポンスヘッダーからOS、Webサーバーバージョン、アプリケーションフレームワークなど、不必要な情報を削除する
The security configuration store for the application should be able to be output in human readable form to support auditing
アプリケーションのセキュリティ設定ストアは、監査をサポートするために人間が読み取り可能な形式で出力可能である必要があります。
アプリケーションのセキュリティ設定関連の情報は監査の為に人が読める形式の出力をサポートしなければならない
Implement an asset management system and register system components and software in it
asset 管理 system を導入し system の component と software を登錄する
Isolate development environments from the production network and provide access only to authorized development and test groups. Development environments are often configured less securely than production environments and attackers may use this difference to discover shared weaknesses or as an avenue for exploitation
開発環境を本番ネットワークから分離し、許可された開発・テストグループのみがアクセスできるようにしてください。開発環境は本番環境よりもセキュリティ設定が緩いことが多く、攻撃者はこの差異を利用して共有脆弱性を発見したり、悪用の足がかりにしたりする可能性があります。
開発環境は運用ネトワークから分離し、許可された開発とテストグループにのみアクセスを許可する。開発環境は運用環境より安全でない設定であることが多く、攻撃者は違いを共通する弱点の発見に利用したり、攻撃へ導いたりする
Implement a software change control system to manage and record changes to the code both in development and production
開發と本番の兩方における code の變更を管理し記錄する爲に software の變更管理 system を導入する
Database Security. databae security
Use strongly typed parameterized queries
強く型附けされた prepared query を使ふ
Utilize input validation and output encoding and be sure to address meta characters. If these fail, do not run the database command
入力値の検証と出力データのエンコーディングを適切に実施し、メタ文字の処理を確実に行ってください。これらの処理が失敗した場合は、データベースコマンドを実行しないでください。
入力バリデーションと出力エンコーディングを利用する。メタ文字(意味を持つ文字)に対応していることを保証する。もしこれらが失敗した場合、データベースコマンドを実行してはならない
(訳注:メタ文字はSQL文とは限らない。現在のDBはJSON、XML、正規表現など様々なシステムをサポートし、それぞれに意味がある文字がある)
Ensure that variables are strongly typed
變數は強く型附けされるやうにする
型システム - Wikipedia#強い型付けと弱い型付け
Strong and weak typing - Wikipedia
What does strong and weak typing mean to you? : r/ProgrammingLanguages
type safety - What is the difference between a strongly typed language and a statically typed language? - Stack Overflow
The application should use the lowest possible level of privilege when accessing the database
データベースアクセス時には、可能な限り低い権限レベルで操作を行うようにしてください。
データベースにアクセスする場合、アプリケーションは最も低い権限でアクセスする
※實用に應じて
(訳注:理想的には検索しか行わない場合、読み込み権限のみを持つ接続でアクセスする方が良い。現実にはアクセスが多いサイトの場合、データベース接続数が2倍以上になるので難しい場合が多いが、リードオンリーのレプリカにアクセスする、などの対策は取れる)
Use secure credentials for database access
DB に access するには安全な認證情報を使用する
Connection strings should not be hard coded within the application. Connection strings should be stored in a separate configuration file on a trusted system and they should be encrypted.
接続文字列はアプリケーション内にハードコードしないでください。信頼できるシステム上の別の設定ファイルに保存し、暗号化を施す必要があります。
接続文字列はアプリケーション内にハードコードしない。接続文字列は信頼できるシステム上の別の設定ファイルに保存し、これらは暗号化する
Use stored procedures to abstract data access and allow for the removal of permissions to the base tables in the database
データアクセスを抽象化し、データベースの基本テーブルに対する権限を後から削除可能にするため、ストアドプロシージャを使用してください。
データアクセスはストアードプロシージャーを利用して抽象化し、データベースのベーステーブルのアクセス権限の削除を許可する
(訳注:直訳で解りずらいですが、ストアドプロシージャーのみに権限を与え、テーブルにアクセス権限を与えない、ということです)
Close the connection as soon as possible
接続は可能な限り速やかに切断してください。
接続が不必要になったら即座に切断する
※實用に應じて
(訳注:永続的接続を使うな、ということではありません)
Remove or change all default database administrative passwords. Utilize strong passwords/phrases or implement multi-factor authentication
デフォルトのデータベース管理用パスワードはすべて削除または変更してください。強力なパスワード/パスフレーズを使用するか、多要素認証を実装してください。
全てのデフォルトのデータベース管理者パスワードを変更するか削除する。強いパスワード/パスフレーズを利用するか、多要素認証を実装する
Turn off all unnecessary database functionality (e.g., unnecessary stored procedures or services, utility packages, install only the minimum set of features and options required (surface area reduction))
不要なデータベース機能はすべて無効化してください(例:不要なストアドプロシージャやサービス、ユーティリティパッケージなど。必要な機能とオプションのみをインストールし、攻撃対象領域を最小限に抑えます)。
不必要なデータベース機能を無効にする(例:不必要なストアードプロシージャーやサービス、ユーティリティパッケージ、最低限必要な機能とオプションをインストールする(攻撃可能範囲の削減))
Remove unnecessary default vendor content (e.g., sample schemas)
不要なデフォルトのベンダー提供コンテンツ(例:サンプルスキーマなど)はすべて削除してください。
不必要なデフォルトのベンダーコンポーネントを削除する(例:サンプルスキーマ)
Disable any default accounts that are not required to support business requirements
ビジネス要件のサポートに必須でないデフォルトアカウントはすべて無効化してください。
全てのデフォルトアカウントを無効にする。例外はビジネス要求に必要な場合
The application should connect to the database with different credentials for every trust distinction (e.g., user, read-only user, guest, administrators)
アプリケーションは、各信頼レベル(例:ユーザー、読み取り専用ユーザー、ゲスト、管理者)ごとに異なる認証情報を使用してデータベースに接続する必要があります。
アプリケーションはそれぞれの信頼区分に応じて異るクレデンシャルでデータベースにアクセスする(例:ユーザー、リードオンリー ユーザー、ゲスト、管理者)
File Management. file 管理
Do not pass user supplied data directly to any dynamic include function
user が提供した data を動的 include 函數に直接渡さない
Require authentication before allowing a file to be uploaded
ファイルのアップロードを許可する前に、必ず認証を行ってください。
ファイルアップロードの前に認証を要求する
Limit the type of files that can be uploaded to only those types that are needed for business purposes
アップロード可能なファイル形式を、業務上必要な形式のみに限定してください。
ビジネスの目的の必要なファイルタイプのみアップロードできる可能なファイルを制限する
Validate uploaded files are the expected type by checking file headers. Checking for file type by extension alone is not sufficient
アップロードされたファイルの種類は、ファイルヘッダーを確認することで期待される形式と一致していることを検証してください。拡張子のみによるファイル形式の判定は不十分です。
ファイルヘッダーをチェックしてアップロードされたファイルタイプが期待する物であるかバリデーションする。拡張子のチェックだけでは不十分
Do not save files in the same web context as the application. Files should either go to the content server or in the database.
アプリケーションと同じウェブコンテキストにファイルを保存しないでください。ファイルはコンテンツサーバーに保存するか、データベースに格納する必要があります。
アプリケーションと同じWebコンテクストにファイルを保存しない。ファイルはコンテンツサーバーかデータベースのどちらかに保存する
Prevent or restrict the uploading of any file that may be interpreted by the web server.
ウェブサーバーによって解釈される可能性のあるファイルのアップロードを防止または制限してください。
Webサーバーによって実行される可能性のあるファイルのアップロードを禁止または制限する
Turn off execution privileges on file upload directories
ファイルアップロードディレクトリの実行権限を無効化してください。
アップロードディレクトリのファイルの実行権限は削除する
Implement safe uploading in UNIX by mounting the targeted file directory as a logical drive using the associated path or the chrooted environment
UNIX環境では、対象のファイルディレクトリを関連パスを使用する論理ドライブとしてマウントするか、chroot環境を利用することで安全なアップロードを実装してください。
UNIX環境では目的のファイルディレクトリをアソシエイテッドパスを使った論理ドライブとしてマウントするかchroot環境を利用し、安全なアップロードを可能にする
When referencing existing files, use a white list of allowed file names and types. Validate the value of the parameter being passed and if it does not match one of the expected values, either reject it or use a hard coded default file value for the content instead
既存ファイルを参照する場合、許可されたファイル名とファイル形式のホワイトリストを使用してください。渡されるパラメータの値を検証し、期待される値のいずれとも一致しない場合は、拒否するか、代わりにハードコードされたデフォルトのファイル値を使用してください。
存在するファイルを参照する場合、許可するファイル名と拡張子のホワイトリストを利用する。渡されるパラメータはバリデーションし、期待する値と異る場合は拒否するか、その値を使わずにハードコードされたデフォルト値を利用する
Do not pass user supplied data into a dynamic redirect. If this must be allowed, then the redirect should accept only validated, relative path URLs
ユーザーから提供されたデータを動的リダイレクトに渡さないでください。もし許可する必要がある場合でも、リダイレクトは検証済みの相対パスURLのみを受け付けるようにしてください。
ユーザーから渡されたデータを動的リダイレクトに利用しない。もしこれを許可しなければならない場合、バリデーションされた物のみか相対URLパスのみ受け入れる
Do not pass directory or file paths, use index values mapped to pre-defined list of paths
ディレクトリやファイルパスを直接渡さないでください。代わりに、事前に定義されたパスリストにマッピングされたインデックス値を使用してください。
ディレクトリやファイルパスを渡さない。定義済みのパスリストのインデックス値を利用する
Never send the absolute file path to the client
絶対ファイルパスをクライアントに送信しないでください。
決して絶対パスをクライアントに送らない
Ensure application files and resources are read-only
アプリケーションファイルとリソースは読み取り専用として設定してください。
アプリケーションファイルとリソースが読み込み専用であることを保証する
(訳注:最近のアプリは自動更新やアプリからのインストールをサポートしているので困難になりつつあるが、これらのシステムでも不可能ではない)
Scan user uploaded files for viruses and malware
ユーザーアップロードファイルをウイルスやマルウェアの有無についてスキャンしてください。
ユーザーがアップロードしたファイルにウィルス/マルウェアが含まれないかスキャンする
Memory Management. memory 管理
Utilize input and output control for un-trusted data
信賴できない data に對しては入出力を制禦する
Double check that the buffer is as large as specified
buffer の大きさを充分に大きく指定してあるかしっかり確認する
When using functions that accept a number of bytes to copy, such as strncpy(), be aware that if the destination buffer size is equal to the source buffer size, it may not NULL-terminate the string
strncpy() のようなバイト数を指定してコピーする関数を使用する場合、コピー先バッファのサイズがソースバッファのサイズと等しい場合、文字列が NULL 終端されない可能性があることに注意すること。
コピーするバイト数を指定できる関数、strncpy()など、を利用する場合、コピー先バッファサイズがコピー元バッファサイズと同じであるよう注意する。ヌル文字で終端されている文字列とは限らない
Check buffer boundaries if calling the function in a loop and make sure there is no danger of writing past the allocated space
ループ内で関数を呼び出す際にはバッファの境界をチェックし、割り当てられた領域を超えて書き込みが行われないようにすること。
関数がループで呼ばれている場合、既に割り当て済みメモリへの書き込みが安全であることを確認し、バッファのバウンダリをチェックする
Truncate all input strings to a reasonable length before passing them to the copy and concatenation functions
コピー関数や文字列結合関数に渡す前に、すべての入力文字列を適切な長さに切り捨てること。
全ての入力文字列はコピーや連結する前に、合理的な長さに切り詰める
Specifically close resources, don’t rely on garbage collection. (e.g., connection objects, file handles, etc.)
特に、リソースは明示的に解放すること。ガベージコレクションに依存してはならない(例:接続オブジェクト、ファイルハンドルなど)。
明示的にリソースをクローズし、ガーベッジコレクションに頼らない(例:接続オブジェクト、ファイルハンドル、など)
Use non-executable stacks when available
利用可能な場合は、非実行可能スタックを使用すること。
利用可能な場合、コード実行不可なスタックを使う
Avoid the use of known vulnerable functions (e.g., printf, strcat, strcpy etc.)
既知の脆弱性が報告されている関数(例:printf、strcat、strcpy など)の使用は避けること。
脆弱な関数として知られている関数は避ける(例:printf、strcat、strcpyなど)
Properly free allocated memory upon the completion of functions and at all exit points
関数の実行完了時およびすべての終了ポイントで、適切に割り当て済みメモリを解放すること。
関数が完了する際に全ての終了箇所で割り当て済みのメモリを適切に解放する
General Coding Practices. 一般的な coding のやり方
Use tested and approved managed code rather than creating new unmanaged code for common tasks
一般的な task には新たな確認されてゐない code を書くよりも試驗され保證された code を使ふ
Utilize task specific built-in APIs to conduct operating system tasks. Do not allow the application to issue commands directly to the Operating System, especially through the use of application initiated command shells
オペレーティングシステム関連のタスクには、タスク専用に用意された組み込みAPIを活用してください。アプリケーションが直接オペレーティングシステムにコマンドを発行することは避け、特にアプリケーションが起動するコマンドシェル経由の操作は許可しないでください。
OSのタスクを実行する場合、特定のタスクに設計されたAPIを利用する。アプリケーションからOSに、特にアプリケーションからシェルを使ったコマンドは、直接実行させない
Use checksums or hashes to verify the integrity of interpreted code, libraries, executables, and configuration files
解釈済みコード、ライブラリ、実行ファイル、および設定ファイルの整合性を確認するため、チェックサムまたはハッシュ値を使用してください。
インタープリタコード、ライブラリ、実行ファイルと設定ファイルにはチェックサムやハッシュを用いて完全性のチェックを行う
(訳注:この種の処理にはHMACを利用すると良い)
Utilize locking to prevent multiple simultaneous requests or use a synchronization mechanism to prevent race conditions
ロック機構を利用して複数の同時リクエストを防止したり、同期メカニズムを実装して競合状態を回避してください。
同時の複数リクエストを防止するためロックを利用するかレースコンディションを防止するための同期メカニズムを利用する
Protect shared variables and resources from inappropriate concurrent access
共有変数やリソースへの不適切な同時アクセスを防止してください。
共有変数やリソースは不適切な同時アクセスから保護する
Explicitly initialize all your variables and other data stores, either during declaration or just before the first usage
すべての変数やその他のデータ格納領域は、宣言時または最初の使用直前に明示的に初期化してください。
全ての変数やデータ保存場所は、宣言するか最初の利用の直前に、明示的に初期化する
In cases where the application must run with elevated privileges, raise privileges as late as possible, and drop them as soon as possible
アプリケーションが昇格権限で実行する必要がある場合、可能な限り遅いタイミングで権限昇格を行い、速やかに権限を剥奪してください。
アプリケーションが昇格した権限で動作しなければならない場合、権限の昇格はできる限り遅くし、権限の降格はできる限り早くする
Avoid calculation errors by understanding your programming language's underlying representation and how it interacts with numeric calculation. Pay close attention to byte size discrepancies, precision, signed/unsigned distinctions, truncation, conversion and casting between types, "not-a- number" calculations, and how your language handles numbers that are too large or too small for its underlying representation
計算エラーを防ぐため、使用しているプログラミング言語の内部表現方式と数値計算との相互作用について十分に理解してください。特に、バイトサイズの不一致、精度、符号付き/符号なしの区別、切り捨て処理、型間の変換/キャスト、「数値ではない」値の計算、および言語がサポートする数値範囲を超えた場合の処理方法に注意が必要です。
プログラミング言語がサポートするデータ型とどのように数値計算が行われるがを理解し、計算エラーを回避する。バイトサイズの不一致、プレシジョン(精度)、符号付き/符号無しの違い、丸め、型変換とキャスト、数値以外(NaN)計算、データ型に対して大きすぎる/小さすぎる場合に言語がどのように処理するかに大きな注意を払う
(訳注:これはデータ型が弱いスクリプト系言語であっても、正しくコードが実行されることを保証するために重要な要素です)
Do not pass user supplied data to any dynamic execution function
ユーザーから提供されたデータを動的実行機能に渡さないでください。
ユーザー入力をいかなる動的実行関数にも与えない
Restrict users from generating new code or altering existing code
ユーザーが新規コードを生成したり既存コードを変更したりすることを禁止してください。
ユーザーが新しいコードや既存のコードを変更することを制限する
Review all secondary applications, third party code and libraries to determine business necessity and validate safe functionality, as these can introduce new vulnerabilities
すべての補助アプリケーション、第三者製コード、ライブラリについて、そのビジネス上の必要性を精査し、安全な機能を検証してください。これらは新たな脆弱性をもたらす可能性があるためです。
全ての契約によって作られたアプリケーション、サードパーティコードとライブラリはビジネス要求を満たすか、機能が安全か検証するかレビューする。これらは新しい脆弱性導入の原因となる
Implement safe updating. If the application will utilize automatic updates, then use cryptographic signatures for your code and ensure your download clients verify those signatures. Use encrypted channels to transfer the code from the host server
安全な更新処理を実装してください。アプリケーションが自動更新を使用する場合、コードに暗号署名を適用し、ダウンロードクライアント側でその署名を検証するようにしてください。また、ホストサーバーからコードを転送する際には暗号化通信チャネルを使用してください。
安全な更新を実装する。アプリケーションが自動更新を利用する場合、暗号理論的な署名をコードに利用し、ダウンロードしたクライアントが署名を確認することを保証する。コードを保存するサーバーからの転送には暗号通信を利用する
OWASP Go Secure Coding Practices Guide (Go-SCP)Go.icon
OWASP Go Secure Coding Practices Guide | OWASP Foundation
OWASP/Go-SCP: Golang Secure Coding Practices guide
和譯 : techtouch-inc/Go-SCP-jaJP: Japanese translated https://github.com/OWASP/Go-SCP/
入力値のバリデーション
バリデーション
サニタイズ
出力のエンコーディング
XSS - クロスサイトスクリプティング
SQL インジェクション
認證とパスワードの管理
認證情報の傳達
認證情報のバリデーションと保存
パスワードポリシー
その他のガイドライン
セッション管理
アクセスコントロール
暗號に關するプラクティス
擬似亂數の生成
エラー處理とロギング
エラー處理
ロギング
データの保護
通信のセキュリティ
HTTP/TLS
WebSocket
システム構成
データベースのセキュリティ
接續
認證
パラメータライズドクエリ
ストアドプロシージャ
ファイル管理
メモリ管理
一般的なコーディングプラクティス
クロスサイトリクエストフォージェリ
正規表現